<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test Ionic Resources</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            padding: 20px;
            background-color: #f0f0f0;
        }
        .test-item {
            margin: 10px 0;
            padding: 10px;
            background-color: white;
            border-radius: 5px;
        }
        .success { background-color: #d4edda; }
        .error { background-color: #f8d7da; }
    </style>
</head>
<body>
    <h1>Ionic 资源加载测试</h1>
    <div id="results"></div>
    
    <script>
        console.log('Test page loaded');
        
        const results = document.getElementById('results');
        
        function addResult(message, isSuccess) {
            const div = document.createElement('div');
            div.className = 'test-item ' + (isSuccess ? 'success' : 'error');
            div.textContent = message;
            results.appendChild(div);
            console.log(message);
        }
        
        // 测试基本功能
        addResult('✓ HTML 页面加载成功', true);
        addResult('✓ JavaScript 执行正常', true);
        
        // 测试 CSS 文件加载
        function testCSS() {
            const link = document.createElement('link');
            link.rel = 'stylesheet';
            link.href = './ionic/css/app.7b141fc5.css';
            link.onload = () => addResult('✓ CSS 文件加载成功', true);
            link.onerror = () => addResult('✗ CSS 文件加载失败', false);
            document.head.appendChild(link);
        }
        
        // 测试图片资源
        function testImage() {
            const img = new Image();
            img.onload = () => addResult('✓ 图片资源加载成功', true);
            img.onerror = () => addResult('✗ 图片资源加载失败', false);
            img.src = './ionic/assets/icon/favicon.png';
        }
        
        // 测试 JavaScript 文件
        function testJS() {
            const script = document.createElement('script');
            script.src = './ionic/js/app.39054f79.js';
            script.onload = () => addResult('✓ JS 文件加载成功', true);
            script.onerror = () => addResult('✗ JS 文件加载失败', false);
            document.head.appendChild(script);
        }
        
        // 运行测试
        setTimeout(() => {
            testCSS();
            testImage();
            testJS();
        }, 1000);
        
        // 检查 Ionic 目录结构
        fetch('./ionic/index.html')
            .then(response => {
                if (response.ok) {
                    addResult('✓ 可以访问 ionic/index.html', true);
                } else {
                    addResult('✗ 无法访问 ionic/index.html', false);
                }
            })
            .catch(error => {
                addResult('✗ Fetch 错误: ' + error.message, false);
            });
    </script>
</body>
</html>